import axios from 'axios'

//根据企业id获取员工列表 
export const getStaffManagement = params => {
   return axios({
      method: 'GET',
      url:`/account/staff/page`,//rentserver/project/detail/3902
      params
    })
}
//根据企业删除员工
export const deleteStaff = id => {
  return axios({
     method: 'delete',
     url:`/account/staff/page/${id}`,//rentserver/project/detail/3902
   })
}
//根据企业id添加员工列表 
export const addStaffs = data => {
  return axios({
     method: 'post',
     url:`/account/staff`,//rentserver/project/detail/3902
     data
   })
}
// 根据id和状态修改员工停用启用状态
export const chanageStat = data => {
   return axios({
      method: 'put',
      url:`/account/staff/edit/status`,//rentserver/project/detail/3902
      data
    })
 }
 export const ExportFile = (url, obj) => {
   axios({
       url: url,
       method: 'get',
       params: obj,
       responseType: 'blob',
       ContentType:'multipart/form-data'
     }).then(response => {
       if (!response) {
         return
     }
     console.log(response);
     let link = document.createElement('a')
     link.href = window.URL.createObjectURL(new Blob([response.data]))
     link.target = '_blank'
     let filename = response.headers['content-disposition']
     link.download = decodeURI(filename)
     document.body.appendChild(link)
     link.click()
     document.body.removeChild(link)
   })
 }